/* ====================================
   页面排版优化样式
   用于改善创新版页面的整体布局
   ==================================== */

/* 1. 整体容器优化 */
.main-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
  background: #f8f9fa;
}

/* 2. 顶部导航栏优化 */
.top-bar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  margin-bottom: 30px;
}

.top-bar h2 {
  color: white;
  margin: 0;
}

.top-bar .user-info span {
  color: rgba(255,255,255,0.95);
}

/* 3. 主内容区优化 - 使用更好的网格布局 */
.main-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* 4. 卡片样式统一优化 */
.section-card,
.compact-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.section-card:hover,
.compact-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.section-card {
  padding: 25px;
}

/* 5. 标题样式优化 */
.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid #667eea;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 6. 创新功能区域 - 分组展示 */
.innovation-section {
  margin-top: 40px;
}

.innovation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.innovation-header h3 {
  margin: 0;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.innovation-header .subtitle {
  font-size: 14px;
  opacity: 0.9;
}

/* 7. 功能分组容器 */
.feature-group {
  margin-bottom: 40px;
}

.feature-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: white;
  border-radius: 12px;
  border-left: 4px solid;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.feature-group-title.gamification {
  border-left-color: #667eea;
}

.feature-group-title.statistics {
  border-left-color: #f093fb;
}

.feature-group-title.tools {
  border-left-color: #4facfe;
}

.feature-group-title.advanced {
  border-left-color: #43e97b;
}

/* 8. 功能网格布局 */
.feature-grid {
  display: grid;
  gap: 20px;
}

/* 游戏化功能 - 3列大卡片 */
.feature-grid.gamification-grid {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* 数据统计 - 2列中等卡片 */
.feature-grid.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

/* 便捷工具 - 4列小卡片 */
.feature-grid.tools-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* 高级功能 - 3列 */
.feature-grid.advanced-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

@media (max-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr !important;
  }
}

/* 9. 紧凑卡片优化 */
.compact-card-header {
  padding: 18px 22px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-size: 16px;
}

.compact-card-body {
  padding: 22px;
}

.compact-card-desc {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 18px;
}

.compact-card-button {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
}

/* 10. 账本卡片优化 */
.books-section {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: 30px;
}

.books-section h3 {
  color: #2c3e50;
  font-size: 20px;
  margin: 0;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.book-card {
  padding: 22px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* 11. 图表区域优化 */
.chart-section {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-top: 30px;
}

.chart-section .section-title {
  border-bottom-color: #4285f4;
}

/* 12. 记录列表优化 */
.records-section {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-top: 30px;
}

.record-item {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border: none;
  transition: all 0.2s ease;
}

.record-item:hover {
  background: #e9ecef;
  transform: translateX(4px);
}

/* 13. 按钮优化 */
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

/* 14. 表单优化 */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 15. 响应式优化 */
@media (max-width: 1400px) {
  .feature-grid.gamification-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 1200px) {
  .feature-grid.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

@media (max-width: 768px) {
  .main-container {
    padding: 15px;
  }
  
  .top-bar {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .innovation-header {
    flex-direction: column;
    text-align: center;
  }
  
  .feature-group-title {
    font-size: 18px;
    padding: 12px 15px;
  }
}

/* 16. 深色模式适配 */
body.dark-mode .main-container {
  background: #121212;
}

body.dark-mode .section-card,
body.dark-mode .compact-card,
body.dark-mode .books-section,
body.dark-mode .chart-section,
body.dark-mode .records-section,
body.dark-mode .feature-group-title {
  background: #1e1e1e;
  color: #e0e0e0;
}

body.dark-mode .section-title,
body.dark-mode .feature-group-title {
  color: #e0e0e0;
}

body.dark-mode .record-item {
  background: #2a2a2a;
}

body.dark-mode .record-item:hover {
  background: #333;
}

body.dark-mode .form-group label {
  color: #b0b0b0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

/* 17. 加载动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-card,
.compact-card {
  animation: fadeInUp 0.4s ease-out;
}

/* 18. 滚动条美化 */
.records-list::-webkit-scrollbar,
#achievementsDisplay::-webkit-scrollbar,
#gameLeaderboard::-webkit-scrollbar {
  width: 8px;
}

.records-list::-webkit-scrollbar-track,
#achievementsDisplay::-webkit-scrollbar-track,
#gameLeaderboard::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.records-list::-webkit-scrollbar-thumb,
#achievementsDisplay::-webkit-scrollbar-thumb,
#gameLeaderboard::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.records-list::-webkit-scrollbar-thumb:hover,
#achievementsDisplay::-webkit-scrollbar-thumb:hover,
#gameLeaderboard::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 19. 统计数据卡片优化 */
.stats-card {
  text-align: center;
  padding: 15px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.stats-card:hover {
  transform: scale(1.05);
}

/* 20. 空状态优化 */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: #999;
  font-size: 16px;
}

.empty-state::before {
  content: '📭';
  display: block;
  font-size: 48px;
  margin-bottom: 15px;
}

